/*
* Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
* Description: mag top union define
* Author: ETH group
* Modify: 2021-02-05
 */

#ifndef MAG_TOP_C_UNION_DEFINE_H
#define MAG_TOP_C_UNION_DEFINE_H

#include "common.h"

/* Define the union csr_mag_fpga_ver_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_fpga_ver : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_fpga_ver_u;

/* Define the union csr_mag_emu_ver_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_emu_ver : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_emu_ver_u;

/* Define the union csr_mag_int_vector_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cpi_int_index : 24; /* [23:0] */
        u32 rsv_0 : 3;              /* [26:24] */
        u32 mag_int_enable : 1;     /* [27] */
        u32 mag_int_issue : 1;      /* [28] */
        u32 rsv_1 : 3;              /* [31:29] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_int_vector_u;

/* Define the union csr_mag_int_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_int_data : 6;           /* [5:0] */
        u32 rsv_2 : 10;                 /* [15:6] */
        u32 mag_program_csr_id_ro : 16; /* [31:16] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_int_u;

/* Define the union csr_mag_int_en_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_int_en : 6;          /* [5:0] */
        u32 rsv_3 : 10;              /* [15:6] */
        u32 mag_program_csr_id : 16; /* [31:16] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_int_en_u;

/* Define the union csr_mag_sopeop_err_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_sopeop_err : 1;         /* [0] */
        u32 mag_sopeop_inj_err : 1;     /* [1] */
        u32 mag_sopeop_err_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_sopeop_err_u;

/* Define the union csr_mag_ram_ucerr_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ucerr : 1;         /* [0] */
        u32 mag_ram_inj_ucerr : 1;     /* [1] */
        u32 mag_ram_ucerr_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ucerr_u;

/* Define the union csr_mag_ram_cerr_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_cerr : 1;         /* [0] */
        u32 mag_ram_inj_cerr : 1;     /* [1] */
        u32 mag_ram_cerr_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_cerr_u;

/* Define the union csr_mag_crdt_err_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_crdt_err : 1;         /* [0] */
        u32 mag_crdt_inj_err : 1;     /* [1] */
        u32 mag_crdt_err_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_crdt_err_u;

/* Define the union csr_mag_fifo_ovfl_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_fifo_ovfl_err : 1;     /* [0] */
        u32 mag_fifo_ovfl_inj_err : 1; /* [1] */
        u32 mag_fifo_ovfl_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_fifo_ovfl_u;

/* Define the union csr_mag_indir_err_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_indir_ilgl_err : 1;     /* [0] */
        u32 mag_indir_ilgl_inj_err : 1; /* [1] */
        u32 mag_indir_ilgl_sticky : 30; /* [31:2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_indir_err_u;

/* Define the union csr_mag_ucerr_ctrl_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_ram_ucerr_ctrl : 1;        /* [0] */
        u32 mag_txp2s_ram_ucerr_ctrl : 1;      /* [1] */
        u32 mag_rxs2p_ram_ucerr_ctrl : 1;      /* [2] */
        u32 mag_cpd_ram_ucerr_ctrl : 1;        /* [3] */
        u32 rsv_4 : 4;                         /* [7:4] */
        u32 mag_cse_pdm_sfifo_ovfl_ctrl : 1;   /* [8] */
        u32 mag_cse_cry_crdt_ovfl_ctrl : 1;    /* [9] */
        u32 mag_txp2s_dat_afifo_ovfl_ctrl : 1; /* [10] */
        u32 mag_txp2s_dat_sfifo_ovfl_ctrl : 1; /* [11] */
        u32 mag_txp2s_crdt_err_ctrl : 1;       /* [12] */
        u32 mag_rtsp_afifo_ovfl_ctrl : 1;      /* [13] */
        u32 mag_rxs2p_dat_afifo_ovfl_ctrl : 1; /* [14] */
        u32 mag_cpd_dat_sfifo_ovfl_ctrl : 1;   /* [15] */
        u32 rsv_5 : 12;                        /* [27:16] */
        u32 mag_top_ucerr_ctrl : 1;            /* [28] */
        u32 top_mag_ucerr_ctrl : 1;            /* [29] */
        u32 mag_top_ucerr_set : 1;             /* [30] */
        u32 top_mag_ucerr_set : 1;             /* [31] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ucerr_ctrl_u;

/* Define the union csr_mag_ram_ctrl_hh_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ctrl_hh : 6; /* [5:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ctrl_hh_u;

/* Define the union csr_mag_ram_ctrl_hm_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ctrl_hm : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ctrl_hm_u;

/* Define the union csr_mag_ram_ctrl_mm_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ctrl_mm : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ctrl_mm_u;

/* Define the union csr_mag_ram_ctrl_ml_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ctrl_ml : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ctrl_ml_u;

/* Define the union csr_mag_ram_ctrl_ll_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ctrl_ll : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ctrl_ll_u;

/* Define the union csr_mag_ram_err_chk_bypass_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_err_chk_bypass : 1; /* [0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_err_chk_bypass_u;

/* Define the union csr_mag_inj_ram_err_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_inj_cse_ram_cerr : 1;         /* [0] */
        u32 mag_inj_cse_ram_ucerr : 1;        /* [1] */
        u32 mag_inj_txdp_txp2s_ram_cerr : 1;  /* [2] */
        u32 mag_inj_txdp_txp2s_ram_ucerr : 1; /* [3] */
        u32 mag_inj_rxdp_cpd_ram_cerr : 1;    /* [4] */
        u32 mag_inj_rxdp_cpd_ram_ucerr : 1;   /* [5] */
        u32 mag_inj_rxdp_rxs2p_ram_cerr : 1;  /* [6] */
        u32 mag_inj_rxdp_rxs2p_ram_ucerr : 1; /* [7] */
        u32 rsv_6 : 24;                       /* [31:8] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_inj_ram_err_cfg_u;

/* Define the union csr_mag_fifo_th_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txp2s_sfifo_sch_th : 6;    /* [5:0] */
        u32 rsv_7 : 2;                     /* [7:6] */
        u32 mag_rtsp_drop_th : 7;          /* [14:8] */
        u32 rsv_8 : 1;                     /* [15] */
        u32 mag_rxdp_cpd_fifo_drop_th : 6; /* [21:16] */
        u32 rsv_9 : 2;                     /* [23:22] */
        u32 mag_rxs2p_afifo_drop_th : 6;   /* [29:24] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_fifo_th_u;

/* Define the union csr_mag_ram_ucerr_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_ucerr_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_ucerr_cnt_u;

/* Define the union csr_mag_ram_cerr_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ram_cerr_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ram_cerr_cnt_u;

/* Define the union csr_mag_indir_access_ilgl_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_indir_access_ilgl_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_indir_access_ilgl_cnt_u;

/* Define the union csr_mag_work_mode_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_mac_work_mode : 16; /* [15:0] */
        u32 mag_mac_fc_mode : 1;    /* [16] */
        u32 mag_txdp_rxdp_loop : 1; /* [17] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_work_mode_u;

/* Define the union csr_mag_ptp_da_h_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_da_h : 16; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_da_h_u;

/* Define the union csr_mag_ptp_da_l_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_da_l : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_da_l_u;

/* Define the union csr_mag_ptp_sa_h_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_sa_h : 16; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_sa_h_u;

/* Define the union csr_mag_ptp_sa_l_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_sa_l : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_sa_l_u;

/* Define the union csr_mag_ptp_etype_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_etype : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_etype_u;

/* Define the union csr_mag_ptp_mask_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_mask : 16; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_mask_u;

/* Define the union csr_mag_ptp_clk_period_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_clk_period_fraction : 30; /* [29:0] */
        u32 mag_ptp_clk_period_integer : 2;   /* [31:30] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_clk_period_u;

/* Define the union csr_mag_ptp_clk_ofs_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_clk_ofs : 31;    /* [30:0] */
        u32 mag_ptp_clk_ofs_inc : 1; /* [31] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_clk_ofs_u;

/* Define the union csr_mag_ptp_clk_snap_en_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_clk_snap_en : 1; /* [0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_clk_snap_en_u;

/* Define the union csr_mag_ptp_snapd_80bclk_h16_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_snapd_80bclk_h16 : 16; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_snapd_80bclk_h16_u;

/* Define the union csr_mag_ptp_snapd_80bclk_m32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_snapd_80bclk_m32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_snapd_80bclk_m32_u;

/* Define the union csr_mag_ptp_snapd_80bclk_l32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_snapd_80bclk_l32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_snapd_80bclk_l32_u;

/* Define the union csr_mag_ptp_snapd_48bclk_h16_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_snapd_48bclk_h16 : 16; /* [15:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_snapd_48bclk_h16_u;

/* Define the union csr_mag_ptp_snapd_48bclk_l32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ptp_snapd_48bclk_l32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ptp_snapd_48bclk_l32_u;

/* Define the union csr_mag_ledc_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_led_prt_sel : 3;   /* [2:0] */
        u32 rsv_10 : 1;            /* [3] */
        u32 mag_led_mode : 4;      /* [7:4] */
        u32 mag_led_blink_prd : 3; /* [10:8] */
        u32 rsv_11 : 1;            /* [11] */
        u32 mag_led_pulse_prd : 3; /* [14:12] */
        u32 rsv_12 : 1;            /* [15] */
        u32 mag_led_polarity : 1;  /* [16] */
        u32 mag_led_en : 1;        /* [17] */
        u32 rsv_13 : 14;           /* [31:18] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ledc_cfg_u;

/* Define the union csr_mag_flc_port_map_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_port_map : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_port_map_u;

/* Define the union csr_mag_flc_tx_cos_bc_h_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_tx_cos4_bc : 8; /* [7:0] */
        u32 mag_flc_tx_cos5_bc : 8; /* [15:8] */
        u32 mag_flc_tx_cos6_bc : 8; /* [23:16] */
        u32 mag_flc_tx_cos7_bc : 8; /* [31:24] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_tx_cos_bc_h_u;

/* Define the union csr_mag_flc_tx_cos_bc_l_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_tx_cos0_bc : 8; /* [7:0] */
        u32 mag_flc_tx_cos1_bc : 8; /* [15:8] */
        u32 mag_flc_tx_cos2_bc : 8; /* [23:16] */
        u32 mag_flc_tx_cos3_bc : 8; /* [31:24] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_tx_cos_bc_l_u;

/* Define the union csr_mag_flc_ipsurx_link_xoff_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_from_ipsurx_link_xoff_bypass : 1; /* [0] */
        u32 mag_flc_from_ipsurx_link_xoff_set : 1;    /* [1] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_ipsurx_link_xoff_u;

/* Define the union csr_mag_flc_bp_set_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_from_rxmac_cos_bp_set : 8;  /* [7:0] */
        u32 mag_flc_from_rxmac_port_bp_set : 1; /* [8] */
        u32 rsv_14 : 7;                         /* [15:9] */
        u32 mag_flc_from_txprm_cos_bp_set : 8;  /* [23:16] */
        u32 mag_flc_from_txprm_port_bp_set : 1; /* [24] */
        u32 mag_flc_from_txfc_port_bp_set : 1;  /* [25] */
        u32 rsv_15 : 6;                         /* [31:26] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_bp_set_u;

/* Define the union csr_mag_flc_bp_bypass_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_from_rxmac_cos_bp_bypass : 8;  /* [7:0] */
        u32 mag_flc_from_rxmac_port_bp_bypass : 1; /* [8] */
        u32 rsv_16 : 7;                            /* [15:9] */
        u32 mag_flc_from_txprm_cos_bp_bypass : 8;  /* [23:16] */
        u32 mag_flc_from_txprm_port_bp_bypass : 1; /* [24] */
        u32 mag_flc_from_txfc_port_bp_bypass : 1;  /* [25] */
        u32 rsv_17 : 6;                            /* [31:26] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_bp_bypass_u;

/* Define the union csr_mag_flc_bp_st_cur_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_from_rxmac_cos_bp_cur : 8;  /* [7:0] */
        u32 mag_flc_from_rxmac_port_bp_cur : 1; /* [8] */
        u32 rsv_18 : 7;                         /* [15:9] */
        u32 mag_flc_from_txprm_cos_bp_cur : 8;  /* [23:16] */
        u32 mag_flc_from_txprm_port_bp_cur : 1; /* [24] */
        u32 mag_flc_from_txfc_port_bp_cur : 1;  /* [25] */
        u32 rsv_19 : 6;                         /* [31:26] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_bp_st_cur_u;

/* Define the union csr_mag_flc_bp_st_hst_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_flc_from_rxmac_cos_bp_hst : 8;  /* [7:0] */
        u32 mag_flc_from_rxmac_port_bp_hst : 1; /* [8] */
        u32 rsv_20 : 7;                         /* [15:9] */
        u32 mag_flc_from_txprm_cos_bp_hst : 8;  /* [23:16] */
        u32 mag_flc_from_txprm_port_bp_hst : 1; /* [24] */
        u32 mag_flc_from_txfc_port_bp_hst : 1;  /* [25] */
        u32 rsv_21 : 6;                         /* [31:26] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_flc_bp_st_hst_u;

/* Define the union csr_mag_cse_port_crdt_ini_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_port_crdt_ini : 7; /* [6:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_port_crdt_ini_u;

/* Define the union csr_mag_cse_port_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_port_dat_cnt : 8;   /* [7:0] */
        u32 mag_cse_port_rdy : 1;       /* [8] */
        u32 mag_cse_wsnd_sopeop_st : 1; /* [9] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_port_st_u;

/* Define the union csr_mag_cse_rcvd_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_rcvd_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_rcvd_pkt_cnt_u;

/* Define the union csr_mag_cse_snt_good_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_snt_good_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_snt_good_pkt_cnt_u;

/* Define the union csr_mag_cse_snt_bad_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_snt_bad_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_snt_bad_pkt_cnt_u;

/* Define the union csr_mag_cse_rcv_petx_cyc_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rcv_petx_cyc_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_rcv_petx_cyc_cnt_u;

/* Define the union csr_mag_cse_snt_petx_pkt_crdt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_snt_petx_pkt_crdt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_snt_petx_pkt_crdt_cnt_u;

/* Define the union csr_mag_cse_snt_petx_cmdidx_crdt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_snt_petx_cmdidx_crdt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_snt_petx_cmdidx_crdt_cnt_u;

/* Define the union csr_mag_cse_snt_cry_cyc_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_snt_cry_cyc_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_snt_cry_cyc_cnt_u;

/* Define the union csr_mag_cse_rcv_cry_crdt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_cse_rcv_cry_crdt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_cse_rcv_cry_crdt_cnt_u;

/* Define the union csr_mag_txdp_port_cfg_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_mac_port_crdt_ini : 11; /* [10:0] */
        u32 rsv_22 : 13;                     /* [23:11] */
        u32 mag_txdp_port_cp_dst_rxport : 3; /* [26:24] */
        u32 mag_txdp_port_cp_frm : 1;        /* [27] */
        u32 mag_txdp_port_ptp_en : 1;        /* [28] */
        u32 rsv_23 : 3;                      /* [31:29] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_port_cfg_u;

/* Define the union csr_mag_txdp_sch_calendar_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_ts0_port : 3; /* [2:0] */
        u32 mag_txdp_ts0_vld : 1;  /* [3] */
        u32 mag_txdp_ts1_port : 3; /* [6:4] */
        u32 mag_txdp_ts1_vld : 1;  /* [7] */
        u32 mag_txdp_ts2_port : 3; /* [10:8] */
        u32 mag_txdp_ts2_vld : 1;  /* [11] */
        u32 mag_txdp_ts3_port : 3; /* [14:12] */
        u32 mag_txdp_ts3_vld : 1;  /* [15] */
        u32 mag_txdp_ts4_port : 3; /* [18:16] */
        u32 mag_txdp_ts4_vld : 1;  /* [19] */
        u32 mag_txdp_ts5_port : 3; /* [22:20] */
        u32 mag_txdp_ts5_vld : 1;  /* [23] */
        u32 mag_txdp_ts6_port : 3; /* [26:24] */
        u32 mag_txdp_ts6_vld : 1;  /* [27] */
        u32 mag_txdp_ts7_port : 3; /* [30:28] */
        u32 mag_txdp_ts7_vld : 1;  /* [31] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_sch_calendar_u;

/* Define the union csr_mag_txdp_short_mac_pkt_len_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_short_mac_pkt_len : 6; /* [5:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_short_mac_pkt_len_u;

/* Define the union csr_mag_txdp_perf_mon_start_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_start : 1; /* [0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_start_u;

/* Define the union csr_mag_txdp_perf_mon_port_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_port : 3; /* [2:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_port_u;

/* Define the union csr_mag_txdp_perf_mon_time_h32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_time_h32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_time_h32_u;

/* Define the union csr_mag_txdp_perf_mon_time_l32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_time_l32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_time_l32_u;

/* Define the union csr_mag_txdp_perf_mon_done_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_done : 1;         /* [0] */
        u32 mag_txdp_perf_mon_pkt_cnt_ovf : 1;  /* [1] */
        u32 mag_txdp_perf_mon_byte_cnt_ovf : 1; /* [2] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_done_u;

/* Define the union csr_mag_txdp_port_st_cur_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_mac_port_crdt_cur : 11;  /* [10:0] */
        u32 mag_txdp_port_wsnd_sopeop_st : 1; /* [11] */
        u32 mag_txdp_from_fc_bp_cur : 1;      /* [12] */
        u32 rsv_24 : 19;                      /* [31:13] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_port_st_cur_u;

/* Define the union csr_mag_txdp_perf_mon_byte_num_h32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_byte_num_h32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_byte_num_h32_u;

/* Define the union csr_mag_txdp_perf_mon_byte_num_l32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_byte_num_l32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_byte_num_l32_u;

/* Define the union csr_mag_txdp_perf_mon_pkt_num_h32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_pkt_num_h32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_pkt_num_h32_u;

/* Define the union csr_mag_txdp_perf_mon_pkt_num_l32_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_perf_mon_pkt_num_l32 : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_perf_mon_pkt_num_l32_u;

/* Define the union csr_mag_txdp_fifo_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txp2s_dat_afifo_wcnt : 4;  /* [3:0] */
        u32 rsv_25 : 4;                    /* [7:4] */
        u32 mag_txp2s_dat_sfifo_cnt : 7;   /* [14:8] */
        u32 rsv_26 : 1;                    /* [15] */
        u32 mag_txp2s_crdt_afifo_rcnt : 5; /* [20:16] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_fifo_cnt_u;

/* Define the union csr_mag_txdp_fifo_cur_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txp2s_dat_afifo_ovfl_cur : 1;   /* [0] */
        u32 mag_txp2s_dat_afifo_full_cur : 1;   /* [1] */
        u32 mag_txp2s_dat_afifo_empty_cur : 1;  /* [2] */
        u32 rsv_27 : 5;                         /* [7:3] */
        u32 mag_txp2s_dat_sfifo_ovfl_cur : 1;   /* [8] */
        u32 mag_txp2s_dat_sfifo_full_cur : 1;   /* [9] */
        u32 mag_txp2s_dat_sfifo_empty_cur : 1;  /* [10] */
        u32 rsv_28 : 5;                         /* [15:11] */
        u32 mag_txp2s_crdt_afifo_ovfl_cur : 1;  /* [16] */
        u32 mag_txp2s_crdt_afifo_full_cur : 1;  /* [17] */
        u32 mag_txp2s_crdt_afifo_empty_cur : 1; /* [18] */
        u32 rsv_29 : 13;                        /* [31:19] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_fifo_cur_st_u;

/* Define the union csr_mag_txdp_fifo_hst_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txp2s_dat_afifo_ovfl_hst : 1;  /* [0] */
        u32 mag_txp2s_dat_afifo_full_hst : 1;  /* [1] */
        u32 rsv_30 : 6;                        /* [7:2] */
        u32 mag_txp2s_dat_sfifo_ovfl_hst : 1;  /* [8] */
        u32 mag_txp2s_dat_sfifo_full_hst : 1;  /* [9] */
        u32 rsv_31 : 6;                        /* [15:10] */
        u32 mag_txp2s_crdt_afifo_ovfl_hst : 1; /* [16] */
        u32 mag_txp2s_crdt_afifo_full_hst : 1; /* [17] */
        u32 rsv_32 : 14;                       /* [31:18] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_fifo_hst_st_u;

/* Define the union csr_mag_txdp_from_fc_bp_hst_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_from_fc_bp_hst : 8; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_from_fc_bp_hst_u;

/* Define the union csr_mag_txdp_rcvd_ptp_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_rcvd_ptp_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_rcvd_ptp_cnt_u;

/* Define the union csr_mag_txdp_recd_sopeop_err_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_recd_sopeop_err_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_recd_sopeop_err_cnt_u;

/* Define the union csr_mag_txdp_port_snt_good_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_port_snt_good_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_port_snt_good_pkt_cnt_u;

/* Define the union csr_mag_txdp_port_snt_bad_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_port_snt_bad_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_port_snt_bad_pkt_cnt_u;

/* Define the union csr_mag_txdp_short_mac_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_txdp_short_mac_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_txdp_short_mac_pkt_cnt_u;

/* Define the union csr_mag_snt_himac_seg_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_snt_himac_seg_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_snt_himac_seg_cnt_u;

/* Define the union csr_mag_rcv_himac_crdt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rcv_himac_crdt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rcv_himac_crdt_cnt_u;

/* Define the union csr_mag_rxdp_port_drop_pfc_pause_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_port_drop_pfc_pause : 8; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_port_drop_pfc_pause_u;

/* Define the union csr_mag_rxdp_rts_port_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_rts_port : 4; /* [3:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_rts_port_u;

/* Define the union csr_mag_rxdp_rts_gap_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_rts_gap : 8; /* [7:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_rts_gap_u;

/* Define the union csr_mag_rxdp_clr_mac_drop_cnt_en_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_clr_mac_drop_cnt_en : 1; /* [0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_clr_mac_drop_cnt_en_u;

/* Define the union csr_mag_rxdp_from_ipsurx_bp_cur_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_from_ipsurx_bp_cur : 1; /* [0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_from_ipsurx_bp_cur_u;

/* Define the union csr_mag_rxdp_port_sopeop_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_port_rcvd_sop_err_cur : 8; /* [7:0] */
        u32 mag_rxdp_port_rcvd_eop_err_cur : 8; /* [15:8] */
        u32 mag_rxdp_port_wrec_sopeop_st : 8;   /* [23:16] */
        u32 mag_ipsurx_wsnd_sopeop_st : 8;      /* [31:24] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_port_sopeop_st_u;

/* Define the union csr_mag_rxdp_fifo_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rtsp_afifo_cnt : 8; /* [7:0] */
        u32 mag_cpd_sfifo_cnt : 7;  /* [14:8] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_fifo_cnt_u;

/* Define the union csr_mag_rxdp_fifo_cur_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxs2p_dat_afifo_ovfl_cur : 1;  /* [0] */
        u32 mag_rxs2p_dat_afifo_full_cur : 1;  /* [1] */
        u32 mag_rxs2p_dat_afifo_empty_cur : 1; /* [2] */
        u32 rsv_33 : 13;                       /* [15:3] */
        u32 mag_rtsp_afifo_ovfl_cur : 1;       /* [16] */
        u32 mag_rtsp_afifo_full_cur : 1;       /* [17] */
        u32 mag_rtsp_afifo_empty_cur : 1;      /* [18] */
        u32 rsv_34 : 5;                        /* [23:19] */
        u32 mag_rxdp_cpd_sfifo_ovfl_cur : 1;   /* [24] */
        u32 mag_rxdp_cpd_sfifo_full_cur : 1;   /* [25] */
        u32 mag_rxdp_cpd_sfifo_empty_cur : 1;  /* [26] */
        u32 rsv_35 : 5;                        /* [31:27] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_fifo_cur_st_u;

/* Define the union csr_mag_rxdp_fifo_hst_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxs2p_dat_afifo_ovfl_hst : 1; /* [0] */
        u32 mag_rxs2p_dat_afifo_full_hst : 1; /* [1] */
        u32 rsv_36 : 14;                      /* [15:2] */
        u32 mag_rtsp_afifo_ovfl_hst : 1;      /* [16] */
        u32 mag_rtsp_afifo_full_hst : 1;      /* [17] */
        u32 rsv_37 : 6;                       /* [23:18] */
        u32 mag_rxdp_cpd_sfifo_ovfl_hst : 1;  /* [24] */
        u32 mag_rxdp_cpd_sfifo_full_hst : 1;  /* [25] */
        u32 rsv_38 : 6;                       /* [31:26] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_fifo_hst_st_u;

/* Define the union csr_mag_rxdp_port_rcvd_seop_err_hst_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_port_rcvd_sop_err_hst : 8; /* [7:0] */
        u32 mag_rxdp_port_rcvd_eop_err_hst : 8; /* [15:8] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_port_rcvd_seop_err_hst_u;

/* Define the union csr_mag_rxdp_from_ipsurx_bp_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_from_ipsurx_bp_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_from_ipsurx_bp_cnt_u;

/* Define the union csr_mag_rxdp_rcvd_rts_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_rts_rcvd_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_rcvd_rts_cnt_u;

/* Define the union csr_mag_rxdp_rts_drop_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_rts_drop_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_rts_drop_cnt_u;

/* Define the union csr_mag_rxdp_rtsp_ovfl_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_rtsp_ovfl_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_rtsp_ovfl_cnt_u;

/* Define the union csr_mag_rxdp_port_recd_good_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_port_recd_good_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_port_recd_good_pkt_cnt_u;

/* Define the union csr_mag_rxdp_port_recd_bad_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_port_recd_bad_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_port_recd_bad_pkt_cnt_u;

/* Define the union csr_mag_rxdp_pause_drop_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_pause_drop_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_pause_drop_cnt_u;

/* Define the union csr_mag_rxs2p_afifo_ovfl_drop_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxs2p_afifo_ovfl_drop_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxs2p_afifo_ovfl_drop_cnt_u;

/* Define the union csr_mag_rxdp_cpd_port_recd_good_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_cpd_port_recd_good_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_cpd_port_recd_good_pkt_cnt_u;

/* Define the union csr_mag_rxdp_cpd_port_recd_bad_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_cpd_port_recd_bad_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_cpd_port_recd_bad_pkt_cnt_u;

/* Define the union csr_mag_rxdp_cpd_fifo_ovfl_drop_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxdp_cpd_fifo_ovfl_drop_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_rxdp_cpd_fifo_ovfl_drop_cnt_u;

/* Define the union csr_mag_ipsurx_port_snt_good_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ipsurx_port_snt_good_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ipsurx_port_snt_good_pkt_cnt_u;

/* Define the union csr_mag_ipsurx_port_snt_bad_pkt_cnt_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_ipsurx_port_snt_bad_pkt_cnt : 32; /* [31:0] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_ipsurx_port_snt_bad_pkt_cnt_u;

/* Define the union csr_mag_lane_los_config_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_rxlos_io_sel : 4; /* [3:0] */
        u32 mag_sds_los_en : 1;   /* [4] */
        u32 mag_rxlos_en : 1;     /* [5] */
        u32 rsv_39 : 26;          /* [31:6] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_lane_los_config_u;

/* Define the union csr_mag_smux_fifo_cur_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_smux_m7_afifo_rcnt : 5;      /* [4:0] */
        u32 mag_smux_m7_afifo_ovfl_cur : 1;  /* [5] */
        u32 mag_smux_m7_afifo_full_cur : 1;  /* [6] */
        u32 mag_smux_m7_afifo_empty_cur : 1; /* [7] */
        u32 mag_smux_m6_afifo_rcnt : 5;      /* [12:8] */
        u32 mag_smux_m6_afifo_ovfl_cur : 1;  /* [13] */
        u32 mag_smux_m6_afifo_full_cur : 1;  /* [14] */
        u32 mag_smux_m6_afifo_empty_cur : 1; /* [15] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_smux_fifo_cur_st_u;

/* Define the union csr_mag_smux_fifo_hst_st_u */
typedef union {
    /* Define the struct bits */
    struct {
        u32 mag_smux_m7_afifo_ovfl_hst : 1; /* [0] */
        u32 mag_smux_m7_afifo_full_hst : 1; /* [1] */
        u32 rsv_40 : 6;                     /* [7:2] */
        u32 mag_smux_m6_afifo_ovfl_hst : 1; /* [8] */
        u32 mag_smux_m6_afifo_full_hst : 1; /* [9] */
        u32 rsv_41 : 6;                     /* [15:10] */
    } bits;

    /* Define an unsigned member */
    u32 value;
} csr_mag_smux_fifo_hst_st_u;


// ==============================================================================
/* Define the global struct */
typedef struct {
    volatile csr_mag_fpga_ver_u mag_fpga_ver;                                                  /* 0 */
    volatile csr_mag_emu_ver_u mag_emu_ver;                                                    /* 4 */
    volatile csr_mag_int_vector_u mag_int_vector;                                              /* 10 */
    volatile csr_mag_int_u mag_int;                                                            /* 14 */
    volatile csr_mag_int_en_u mag_int_en;                                                      /* 18 */
    volatile csr_mag_sopeop_err_u mag_sopeop_err;                                              /* 1C */
    volatile csr_mag_ram_ucerr_u mag_ram_ucerr;                                                /* 20 */
    volatile csr_mag_ram_cerr_u mag_ram_cerr;                                                  /* 24 */
    volatile csr_mag_crdt_err_u mag_crdt_err;                                                  /* 28 */
    volatile csr_mag_fifo_ovfl_u mag_fifo_ovfl;                                                /* 2C */
    volatile csr_mag_indir_err_u mag_indir_err;                                                /* 30 */
    volatile csr_mag_ucerr_ctrl_u mag_ucerr_ctrl;                                              /* 100 */
    volatile csr_mag_ram_ctrl_hh_u mag_ram_ctrl_hh;                                            /* 104 */
    volatile csr_mag_ram_ctrl_hm_u mag_ram_ctrl_hm;                                            /* 108 */
    volatile csr_mag_ram_ctrl_mm_u mag_ram_ctrl_mm;                                            /* 10C */
    volatile csr_mag_ram_ctrl_ml_u mag_ram_ctrl_ml;                                            /* 110 */
    volatile csr_mag_ram_ctrl_ll_u mag_ram_ctrl_ll;                                            /* 114 */
    volatile csr_mag_ram_err_chk_bypass_u mag_ram_err_chk_bypass;                              /* 118 */
    volatile csr_mag_inj_ram_err_cfg_u mag_inj_ram_err_cfg;                                    /* 11C */
    volatile csr_mag_fifo_th_u mag_fifo_th;                                                    /* 120 */
    volatile csr_mag_ram_ucerr_cnt_u mag_ram_ucerr_cnt;                                        /* 600 */
    volatile csr_mag_ram_cerr_cnt_u mag_ram_cerr_cnt;                                          /* 604 */
    volatile csr_mag_indir_access_ilgl_cnt_u mag_indir_access_ilgl_cnt;                        /* 608 */
    volatile csr_mag_work_mode_u mag_work_mode;                                                /* 1000 */
    volatile csr_mag_ptp_da_h_u mag_ptp_da_h;                                                  /* 1004 */
    volatile csr_mag_ptp_da_l_u mag_ptp_da_l;                                                  /* 1008 */
    volatile csr_mag_ptp_sa_h_u mag_ptp_sa_h;                                                  /* 100C */
    volatile csr_mag_ptp_sa_l_u mag_ptp_sa_l;                                                  /* 1010 */
    volatile csr_mag_ptp_etype_u mag_ptp_etype;                                                /* 1014 */
    volatile csr_mag_ptp_mask_u mag_ptp_mask;                                                  /* 1018 */
    volatile csr_mag_ptp_clk_period_u mag_ptp_clk_period;                                      /* 5000 */
    volatile csr_mag_ptp_clk_ofs_u mag_ptp_clk_ofs;                                            /* 5004 */
    volatile csr_mag_ptp_clk_snap_en_u mag_ptp_clk_snap_en;                                    /* 5008 */
    volatile csr_mag_ptp_snapd_80bclk_h16_u mag_ptp_snapd_80bclk_h16;                          /* 5400 */
    volatile csr_mag_ptp_snapd_80bclk_m32_u mag_ptp_snapd_80bclk_m32;                          /* 5404 */
    volatile csr_mag_ptp_snapd_80bclk_l32_u mag_ptp_snapd_80bclk_l32;                          /* 5408 */
    volatile csr_mag_ptp_snapd_48bclk_h16_u mag_ptp_snapd_48bclk_h16;                          /* 540C */
    volatile csr_mag_ptp_snapd_48bclk_l32_u mag_ptp_snapd_48bclk_l32;                          /* 5410 */
    volatile csr_mag_ledc_cfg_u mag_ledc_cfg[24];                                              /* 6000 */
    volatile csr_mag_flc_port_map_u mag_flc_port_map;                                          /* 7000 */
    volatile csr_mag_flc_tx_cos_bc_h_u mag_flc_tx_cos_bc_h[8];                                 /* 7004 */
    volatile csr_mag_flc_tx_cos_bc_l_u mag_flc_tx_cos_bc_l[8];                                 /* 7100 */
    volatile csr_mag_flc_ipsurx_link_xoff_u mag_flc_ipsurx_link_xoff;                          /* 7200 */
    volatile csr_mag_flc_bp_set_u mag_flc_bp_set[8];                                           /* 7300 */
    volatile csr_mag_flc_bp_bypass_u mag_flc_bp_bypass[8];                                     /* 7400 */
    volatile csr_mag_flc_bp_st_cur_u mag_flc_bp_st_cur[8];                                     /* 7700 */
    volatile csr_mag_flc_bp_st_hst_u mag_flc_bp_st_hst[8];                                     /* 7800 */
    volatile csr_mag_cse_port_crdt_ini_u mag_cse_port_crdt_ini[11];                            /* 8000 */
    volatile csr_mag_cse_port_st_u mag_cse_port_st[11];                                        /* 8400 */
    volatile csr_mag_cse_rcvd_pkt_cnt_u mag_cse_rcvd_pkt_cnt[11];                              /* 8C00 */
    volatile csr_mag_cse_snt_good_pkt_cnt_u mag_cse_snt_good_pkt_cnt[11];                      /* 8C40 */
    volatile csr_mag_cse_snt_bad_pkt_cnt_u mag_cse_snt_bad_pkt_cnt[11];                        /* 8C80 */
    volatile csr_mag_cse_rcv_petx_cyc_cnt_u mag_cse_rcv_petx_cyc_cnt[11];                      /* 8CC0 */
    volatile csr_mag_cse_snt_petx_pkt_crdt_cnt_u mag_cse_snt_petx_pkt_crdt_cnt[11];            /* 8CEC */
    volatile csr_mag_cse_snt_petx_cmdidx_crdt_cnt_u mag_cse_snt_petx_cmdidx_crdt_cnt;          /* 8D18 */
    volatile csr_mag_cse_snt_cry_cyc_cnt_u mag_cse_snt_cry_cyc_cnt[3];                         /* 8D1C */
    volatile csr_mag_cse_rcv_cry_crdt_cnt_u mag_cse_rcv_cry_crdt_cnt[3];                       /* 8D28 */
    volatile csr_mag_txdp_port_cfg_u mag_txdp_port_cfg[8];                                     /* 9000 */
    volatile csr_mag_txdp_sch_calendar_u mag_txdp_sch_calendar;                                /* 9040 */
    volatile csr_mag_txdp_short_mac_pkt_len_u mag_txdp_short_mac_pkt_len;                      /* 9044 */
    volatile csr_mag_txdp_perf_mon_start_u mag_txdp_perf_mon_start;                            /* 9048 */
    volatile csr_mag_txdp_perf_mon_port_u mag_txdp_perf_mon_port;                              /* 904C */
    volatile csr_mag_txdp_perf_mon_time_h32_u mag_txdp_perf_mon_time_h32;                      /* 9050 */
    volatile csr_mag_txdp_perf_mon_time_l32_u mag_txdp_perf_mon_time_l32;                      /* 9054 */
    volatile csr_mag_txdp_perf_mon_done_u mag_txdp_perf_mon_done;                              /* 9400 */
    volatile csr_mag_txdp_port_st_cur_u mag_txdp_port_st_cur[8];                               /* 9410 */
    volatile csr_mag_txdp_perf_mon_byte_num_h32_u mag_txdp_perf_mon_byte_num_h32;              /* 9440 */
    volatile csr_mag_txdp_perf_mon_byte_num_l32_u mag_txdp_perf_mon_byte_num_l32;              /* 9444 */
    volatile csr_mag_txdp_perf_mon_pkt_num_h32_u mag_txdp_perf_mon_pkt_num_h32;                /* 9448 */
    volatile csr_mag_txdp_perf_mon_pkt_num_l32_u mag_txdp_perf_mon_pkt_num_l32;                /* 944C */
    volatile csr_mag_txdp_fifo_cnt_u mag_txdp_fifo_cnt;                                        /* 9450 */
    volatile csr_mag_txdp_fifo_cur_st_u mag_txdp_fifo_cur_st;                                  /* 9454 */
    volatile csr_mag_txdp_fifo_hst_st_u mag_txdp_fifo_hst_st;                                  /* 9458 */
    volatile csr_mag_txdp_from_fc_bp_hst_u mag_txdp_from_fc_bp_hst;                            /* 945C */
    volatile csr_mag_txdp_rcvd_ptp_cnt_u mag_txdp_rcvd_ptp_cnt;                                /* 9C00 */
    volatile csr_mag_txdp_recd_sopeop_err_cnt_u mag_txdp_recd_sopeop_err_cnt;                  /* 9C04 */
    volatile csr_mag_txdp_port_snt_good_pkt_cnt_u mag_txdp_port_snt_good_pkt_cnt[8];           /* 9C08 */
    volatile csr_mag_txdp_port_snt_bad_pkt_cnt_u mag_txdp_port_snt_bad_pkt_cnt[8];             /* 9C48 */
    volatile csr_mag_txdp_short_mac_pkt_cnt_u mag_txdp_short_mac_pkt_cnt;                      /* 9C80 */
    volatile csr_mag_snt_himac_seg_cnt_u mag_snt_himac_seg_cnt[8];                             /* 9C84 */
    volatile csr_mag_rcv_himac_crdt_cnt_u mag_rcv_himac_crdt_cnt[8];                           /* 9CA4 */
    volatile csr_mag_rxdp_port_drop_pfc_pause_u mag_rxdp_port_drop_pfc_pause;                  /* A000 */
    volatile csr_mag_rxdp_rts_port_u mag_rxdp_rts_port;                                        /* A004 */
    volatile csr_mag_rxdp_rts_gap_u mag_rxdp_rts_gap;                                          /* A008 */
    volatile csr_mag_rxdp_clr_mac_drop_cnt_en_u mag_rxdp_clr_mac_drop_cnt_en;                  /* A00C */
    volatile csr_mag_rxdp_from_ipsurx_bp_cur_u mag_rxdp_from_ipsurx_bp_cur;                    /* A010 */
    volatile csr_mag_rxdp_port_sopeop_st_u mag_rxdp_port_sopeop_st;                            /* A014 */
    volatile csr_mag_rxdp_fifo_cnt_u mag_rxdp_fifo_cnt;                                        /* A018 */
    volatile csr_mag_rxdp_fifo_cur_st_u mag_rxdp_fifo_cur_st;                                  /* A01C */
    volatile csr_mag_rxdp_fifo_hst_st_u mag_rxdp_fifo_hst_st;                                  /* A020 */
    volatile csr_mag_rxdp_port_rcvd_seop_err_hst_u mag_rxdp_port_rcvd_seop_err_hst;            /* A024 */
    volatile csr_mag_rxdp_from_ipsurx_bp_cnt_u mag_rxdp_from_ipsurx_bp_cnt;                    /* A028 */
    volatile csr_mag_rxdp_rcvd_rts_cnt_u mag_rxdp_rcvd_rts_cnt;                                /* A02C */
    volatile csr_mag_rxdp_rts_drop_cnt_u mag_rxdp_rts_drop_cnt;                                /* A030 */
    volatile csr_mag_rxdp_rtsp_ovfl_cnt_u mag_rxdp_rtsp_ovfl_cnt;                              /* A034 */
    volatile csr_mag_rxdp_port_recd_good_pkt_cnt_u mag_rxdp_port_recd_good_pkt_cnt[8];         /* AC90 */
    volatile csr_mag_rxdp_port_recd_bad_pkt_cnt_u mag_rxdp_port_recd_bad_pkt_cnt[8];           /* ACD0 */
    volatile csr_mag_rxdp_pause_drop_cnt_u mag_rxdp_pause_drop_cnt[8];                         /* AD10 */
    volatile csr_mag_rxs2p_afifo_ovfl_drop_cnt_u mag_rxs2p_afifo_ovfl_drop_cnt[8];             /* AD50 */
    volatile csr_mag_rxdp_cpd_port_recd_good_pkt_cnt_u mag_rxdp_cpd_port_recd_good_pkt_cnt[8]; /* AD90 */
    volatile csr_mag_rxdp_cpd_port_recd_bad_pkt_cnt_u mag_rxdp_cpd_port_recd_bad_pkt_cnt[8];   /* ADD0 */
    volatile csr_mag_rxdp_cpd_fifo_ovfl_drop_cnt_u mag_rxdp_cpd_fifo_ovfl_drop_cnt[8];         /* AE10 */
    volatile csr_mag_ipsurx_port_snt_good_pkt_cnt_u mag_ipsurx_port_snt_good_pkt_cnt[8];       /* AE50 */
    volatile csr_mag_ipsurx_port_snt_bad_pkt_cnt_u mag_ipsurx_port_snt_bad_pkt_cnt[8];         /* AE90 */
    volatile csr_mag_lane_los_config_u mag_lane_los_config[8];                                 /* B000 */
    volatile csr_mag_smux_fifo_cur_st_u mag_smux_fifo_cur_st;                                  /* B020 */
    volatile csr_mag_smux_fifo_hst_st_u mag_smux_fifo_hst_st;                                  /* B024 */
} S_mag_csr_REGS_TYPE;

/* Declare the struct pointor of the module mag_csr */
extern volatile S_mag_csr_REGS_TYPE *gopmag_csrAllReg;

/* 1822 reserved for emu test */
/* Define the union u_magtop_int_status */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int rxdp : 1;        /* [0]  */
        unsigned int txdp : 1;        /* [1]  */
        unsigned int fc : 1;          /* [2]  */
        unsigned int tsp : 1;         /* [3]  */
        unsigned int unimac : 6;      /* [9..4]  */
        unsigned int reserved_0 : 22; /* [31..10]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_int_status;

/* Define the union u_magtop_int_enable */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int rxdp : 1;        /* [0]  */
        unsigned int txdp : 1;        /* [1]  */
        unsigned int fc : 1;          /* [2]  */
        unsigned int tsp : 1;         /* [3]  */
        unsigned int unimac : 6;      /* [9..4]  */
        unsigned int reserved_0 : 22; /* [31..10]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_int_enable;

/* Define the union u_magtop_glb_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 31; /* [31..1]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_glb_rstn;

/* Define the union u_magtop_rxdp_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int all : 1;         /* [4]  */
        unsigned int reserved_1 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_rxdp_rstn;

/* Define the union u_magtop_txdp_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int all : 1;         /* [4]  */
        unsigned int reserved_1 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_txdp_rstn;

/* Define the union u_magtop_unimac_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int all : 1;         /* [4]  */
        unsigned int reserved_1 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_unimac_rstn;

/* Define the union u_magtop_fc_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int all : 1;         /* [4]  */
        unsigned int reserved_1 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_fc_rstn;

/* Define the union u_magtop_tsp_rstn */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int logic : 1;       /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int all : 1;         /* [4]  */
        unsigned int reserved_1 : 3;  /* [7..5]  */
        unsigned int i2c : 1;         /* [8]  */
        unsigned int reserved_2 : 23; /* [31..9]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_tsp_rstn;

/* Define the union u_magtop_port_ctrl */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int port_mode : 5;   /* [4..0]  */
        unsigned int reserved_0 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_port_ctrl;

/* Define the union u_magtop_slv_base_addr_h */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int base_addr : 16;  /* [15..0]  */
        unsigned int reserved_0 : 16; /* [31..16]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_slv_base_addr_h;

/* Define the union u_magtop_loop_en */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int rxdp2txdp : 1;   /* [0]  */
        unsigned int reserved_0 : 31; /* [31..1]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_loop_en;

/* Define the union u_magtop_uer_cfg */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int mask : 2;        /* [1..0]  */
        unsigned int reserved_0 : 2;  /* [3..2]  */
        unsigned int set : 2;         /* [5..4]  */
        unsigned int reserved_1 : 26; /* [31..6]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_uer_cfg;

/* Define the union u_magtop_uer_info */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int block_id : 10;   /* [9..0]  */
        unsigned int reserved_0 : 22; /* [31..10]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_uer_info;

/* Define the union u_magtop_mfs_sch_calendar */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int cal : 1;         /* [0]  */
        unsigned int reserved_0 : 3;  /* [3..1]  */
        unsigned int vld : 1;         /* [4]  */
        unsigned int reserved_1 : 27; /* [31..5]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_mfs_sch_calendar;

/* Define the union u_magtop_mfs_sch_calendar_length */
typedef union {
    /* Define the struct bits */
    struct {
        unsigned int len : 4;         /* [3..0]  */
        unsigned int reserved_0 : 28; /* [31..4]  */
    } bits;

    /* Define an unsigned member */
    unsigned int val32;
} u_magtop_mfs_sch_calendar_length;

#endif // MAG_TOP_C_UNION_DEFINE_H
